<?php

namespace app\mobileapp\validate;

use think\Validate;

class Content extends Validate
{

    protected $rule = [
        'category_id' => 'require',
        'comment_status' => 'require|between:0,1',
        'same_sex_status' => 'require|between:0,1',
        'expect_object' => 'require',
        'begin_date' => 'require',
        'end_date' => 'require',
        'content' => 'require',
        'member_id' => 'require',
        'location' => 'require',
    ];

    protected $message = [
        'category_id.require' => '分类不能为空',
        'comment_status.require' => '评论权限不能为空',
        'comment_status.between' => '评论权限只能开启或关闭',
        'same_sex_status.require' => '同性是否隐藏不能为空',
        'same_sex_status.same_sex_status' => '同性是否隐藏只能开启或关闭',
        'expect_object.require' => '期望对象不能为空',
        'begin_date.require' => '开始时间不能为空',
        'end_date.require' => '结束时间不能为空',
        'content.require' => '留言不能为空',
        'member_id.require' => '发布人不能为空',
        'location.require' => '城市不能为空',
    ];


    protected $scene = [
        'publishDynamic' => ['comment_status', 'same_sex_status', 'content'],
        'publishProgram' => ['category_id', 'comment_status', 'same_sex_status', 'expect_object', 'begin_date', 'end_date','location'],
    ];

}